package com.jy.oms.framework.asyn.task.checker.model;

import com.jy.oms.framework.asyn.task.constants.TaskStateEnum;

import java.util.Date;

/**
 * 校验器结果
 *
 * @author liuquan
 */
public class ExecutorCheckResult {

    //能运行执行器
    public static ExecutorCheckResult TRUE = new ExecutorCheckResult(true);

    //不能运行执行器
    public static ExecutorCheckResult FALSE = new ExecutorCheckResult(false);

    /**
     * 是否可执行任务
     */
    private boolean result;

    /**
     * 任务状态
     */
    private TaskStateEnum taskState = TaskStateEnum.UNDO;

    /**
     * 任务最早可执行时间
     */
    private Date earliestExecuteTime;

    public ExecutorCheckResult() {
    }

    public ExecutorCheckResult(boolean result) {
        this.result = result;
    }

    public ExecutorCheckResult(Date earliestExecuteTime) {
        this.earliestExecuteTime = earliestExecuteTime;
    }

    public boolean isResult() {
        return result;
    }

    public ExecutorCheckResult setResult(boolean result) {
        this.result = result;
        return this;
    }

    public Date getEarliestExecuteTime() {
        return earliestExecuteTime;
    }

    public ExecutorCheckResult setEarliestExecuteTime(Date earliestExecuteTime) {
        this.earliestExecuteTime = earliestExecuteTime;
        return this;
    }

    public TaskStateEnum getTaskState() {
        return taskState;
    }

    public void setTaskState(TaskStateEnum taskState) {
        this.taskState = taskState;
    }
}
